package com.service.Impl;

import com.bean.Goods;
import com.bean.GoodsType;
import com.bean.User;
import com.mapper.GoodsMapper;
import com.mapper.UserMapper;
import com.service.GoodsService;
import com.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServiceImpl implements GoodsService {
    @Autowired//IoC
	GoodsMapper goodsMapper;//数据访问层对象

	@Override
	public List<Goods> queryGoods() {
		return goodsMapper.queryGoods();
	}

	@Override
	public List<Goods> queryGoodsByNmae(String goodsname) {
		return goodsMapper.queryGoodsByNmae(goodsname);
	}

	@Override
	public int updateGoodsById(Goods goods) {
		return goodsMapper.updateGoodsById(goods);
	}

	@Override
	public int addGoods(Goods goods) {
		return goodsMapper.addGoods(goods);
	}

	@Override
	public int deleteGoods(int id) {
		return goodsMapper.deleteGoods(id);
	}

}
